package domain.controller;

import java.io.IOException;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.http.*;

import domain.service.Utils;

@SuppressWarnings("serial")
public class DomainServlet extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		resp.setContentType("text/plain");
		resp.getWriter().println("Hello, world");
		
		Date date_cache = new Date(new Date().getTime()+60*60*1000);
		
		resp.setHeader( "Cache-Control", "public, max-age=30");
		resp.setHeader( "Expires", date_cache.toGMTString() );
		req.setAttribute("title", "Analysis and evaluation of website information");
		req.setAttribute("description",  Utils.ValidDomain()+" - A Free SEO tool that provides free website analysis, traffic details, rankings, contact email ,similar site, same owner site , same ip site, optimization and promotion reports.");
		req.setAttribute("keyword",  Utils.ValidDomain()+",Domain name information,  Server information, Web site analysis, website traffic details, Website backlinks website IP, website ranking info");
		
		try {
			req.getRequestDispatcher("/index.jsp").forward(req, resp);
		} catch (ServletException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
